// 字体
// @font-face {
//   font-family: 'AlibabaPuHuiTi';
//   font-style: normal;
//   src: url('/fonts/AlibabaPuHuiTi-3-55-Regular.subset.woff2') format('woff2');
// }

body {
  // -webkit-filter: grayscale(100%);
  // font-family: system-ui, -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei UI, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 18px; // 原 16px
}

// 修复滚动条存在导致 header 挤压位移
header {
  width: 100vw;
}

.wormhole {
  [theme="dark"] & {
    filter: invert(80%) !important;
  }
  [theme="black"] & {
    filter: invert(100%) !important;
  }
}

// 代码全屏
// .single .content .highlight .fullscreen {
//   background-color: aqua;
//   --widthA: 100%;
//   --widthB: calc(var(--widthA) - 30px);
//   height: var(--widthB);
//   min-height: 99%;
//   overflow-y: hidden;
//   overflow-x: auto;
//   height: auto;
// }

// 猫耳  From Misskey && Firefish
@mixin cat-ear-styles {
  &::before,
  &::after {
    background: #ebbcba;
    border: solid 3px #ead9d8;
    box-sizing: border-box;
    content: "";
    display: inline-block;
    height: 50px;
    width: 50px;
  }

  &::before {
    border-radius: 25% 75% 75%;
    transform: rotate(37.5deg) skew(30deg);
  }

  &::after {
    border-radius: 75% 25% 75% 75%;
    transform: rotate(-37.5deg) skew(-30deg);
  }
}

.home {
  .home-profile {
    .home-avatar {
      a {
        position: absolute;
        z-index: 2;
        // overflow: hidden;
        object-fit: cover;
        width: 100px;
        height: 100px;
        left: calc(50% - 50px);

        @include cat-ear-styles;

        &::before,
        &::after {
          height: 48px;
          width: 48px;
          margin-top: 5px;
        }

        &:hover {
          transform: none;
        }

        img {
          position: absolute;
          bottom: 0;
          left: 0;
          right: 0;
          top: 0;
          border-radius: 100%;
          z-index: 1;
          overflow: hidden;
          object-fit: cover;

          &:hover {
            position: absolute;
          }
        }
      }

      & {
        height: 120px;

        a:hover::before {
          // transform: translateY(-0.75rem);
          animation: earwiggleleft 1s infinite;
        }

        a:hover::after {
          // transform: translateY(-0.75rem);
          animation: earwiggleright 1s infinite;
        }
      }
    }
  }
}

.single .sponsor .sponsor-avatar {
  @include cat-ear-styles;

  &::before,
  &::after {
    height: 48px;
    width: 48px;
    margin-top: 15px;
  }

  img {
    position: absolute;
    left: calc(50% - 57.5px);
    border-radius: 100%;
    z-index: 1;
    overflow: hidden;
    object-fit: cover;
  }

  & {
    height: 120px;

    &:hover::before {
      // transform: translateY(-0.75rem);
      animation: earwiggleleft 1s infinite;
    }

    &:hover::after {
      // transform: translateY(-0.75rem);
      animation: earwiggleright 1s infinite;
    }
  }
}

// 猫耳悬浮动画
@keyframes earwiggleleft {
  0% {
    transform: rotate(37.6deg) skew(30deg);
  }

  25% {
    transform: rotate(10deg) skew(30deg);
  }

  50% {
    transform: rotate(20deg) skew(30deg);
  }

  75% {
    transform: rotate(0) skew(30deg);
  }

  to {
    transform: rotate(37.6deg) skew(30deg);
  }
}

@keyframes earwiggleright {
  0% {
    transform: rotate(-37.6deg) skew(-30deg);
  }

  30% {
    transform: rotate(-10deg) skew(-30deg);
  }

  55% {
    transform: rotate(-20deg) skew(-30deg);
  }

  75% {
    transform: rotate(0) skew(-30deg);
  }

  to {
    transform: rotate(-37.6deg) skew(-30deg);
  }
}

// 南小鸟

@keyframes slide-in {
  to {
    left: 0;
    bottom: 0;
  }
}

.nxn {
  // PC
  opacity: 0.9;
  position: fixed;
  bottom: -100%;
  left: -100%;
  width: 200px;
  max-width: 33%;
  z-index: -1;
  animation: slide-in 1s forwards; /* 抢镜 */

  // PAD
  @media (max-width: 1000px) {
    opacity: 0.6;
    max-width: 15%;
  }

  // PHONE
  @media (max-width: 680px) {
    opacity: 0.3;
    max-width: 33%;
  }
}

// SWUP CSS
html.is-changing .transition-fade {
  transition: opacity 0.1s;
  opacity: 1;
}
/* Define the styles for the unloaded pages */
html.is-animating .transition-fade {
  opacity: 0;
}

.fa-regular--laugh-wink {
  display: inline-block;
  width: 1em;
  height: 1em;
  --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath fill='%23000' d='M248 8C111 8 0 119 0 256s111 248 248 248s248-111 248-248S385 8 248 8m141.4 389.4c-37.8 37.8-88 58.6-141.4 58.6s-103.6-20.8-141.4-58.6C68.8 359.6 48 309.4 48 256s20.8-103.6 58.6-141.4C144.4 76.8 194.6 56 248 56s103.6 20.8 141.4 58.6c37.8 37.8 58.6 88 58.6 141.4s-20.8 103.6-58.6 141.4M328 164c-25.7 0-55.9 16.9-59.9 42.1c-1.7 11.2 11.5 18.2 19.8 10.8l9.5-8.5c14.8-13.2 46.2-13.2 61 0l9.5 8.5c8.5 7.4 21.6.3 19.8-10.8c-3.8-25.2-34-42.1-59.7-42.1m-160 60c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32m194.4 64H133.6c-8.2 0-14.5 7-13.5 15c7.5 59.2 58.9 105 121.1 105h13.6c62.2 0 113.6-45.8 121.1-105c1-8-5.3-15-13.5-15'/%3E%3C/svg%3E");
  background-color: currentColor;
  -webkit-mask-image: var(--svg);
  mask-image: var(--svg);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

// .fa-solid--grin-wink {
//   display: inline-block;
//   width: 1em;
//   height: 1em;
//   --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath fill='%23000' d='M0 256c0 137 111 248 248 248s248-111 248-248S385 8 248 8S0 119 0 256m200-48c0 17.7-14.3 32-32 32s-32-14.3-32-32s14.3-32 32-32s32 14.3 32 32m168 25l-9.5-8.5c-14.8-13.2-46.2-13.2-61 0L288 233c-8.3 7.4-21.6.4-19.8-10.8c4-25.2 34.2-42.1 59.9-42.1S384 197 388 222.2c1.6 11-11.5 18.2-20 10.8m-243.1 87.8C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.3-3.7 22.6 6 20.7 17.9c-9.2 55-83.2 93.3-143.8 93.3s-134.5-38.3-143.8-93.3c-2-11.9 9.3-21.6 20.7-17.9'/%3E%3C/svg%3E");
//   background-color: currentColor;
//   -webkit-mask-image: var(--svg);
//   mask-image: var(--svg);
//   -webkit-mask-repeat: no-repeat;
//   mask-repeat: no-repeat;
//   -webkit-mask-size: 100% 100%;
//   mask-size: 100% 100%;
// }

// 检索页 hr

.retrieval {
  // .archive-title {
  //   display: flex;
  //   align-items: center;
  //   gap: 0.5rem;
  // }
  hr {
    margin: 0.5rem 0;
    position: relative;
    border-top: 3px dashed $global-border-color;
    border-bottom: none;
  }
}


.medium-zoom-overlay,
.medium-zoom-image--opened {
  z-index: 999;
}

// popover
.popover {
  position: absolute;
  display: none;
  padding: 10px;
  border: 1px solid rgba(35, 101, 194, 0.9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  // width: 600px;
  background-color: var(--global-background-color);
  z-index: 15;
  width: 600px;
  max-width: 90%;

  word-wrap: break-word;
}


.popover-link {
  text-decoration: none;
  font-size: 18px;
}

.popover-link-img {
  text-decoration: none;
  font-size: 18px;
}

.popover-link-img:hover + .popover {
  display: block;
}

.page {
  hr {
    margin: 0.5rem 0;
    position: relative;
    border-top: 3px dashed $global-border-color;
    border-bottom: none;
  }
}